<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="utf-8">
  
  <title>Python Import | gdme1320 的笔记</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="Table of Contents   Example 1, Import a python module with python interpreter: Example 2, Use execfile or (exec in Python 3) in a script to execute the other python file in place: Example 3, Use fr">
<meta property="og:type" content="article">
<meta property="og:title" content="Python Import">
<meta property="og:url" content="http://gdme1320.gitee.com/python/import/index.html">
<meta property="og:site_name" content="gdme1320 的笔记">
<meta property="og:description" content="Table of Contents   Example 1, Import a python module with python interpreter: Example 2, Use execfile or (exec in Python 3) in a script to execute the other python file in place: Example 3, Use fr">
<meta property="og:locale" content="default">
<meta property="og:updated_time" content="2022-03-23T09:59:19.561Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Python Import">
<meta name="twitter:description" content="Table of Contents   Example 1, Import a python module with python interpreter: Example 2, Use execfile or (exec in Python 3) in a script to execute the other python file in place: Example 3, Use fr">
  
    <link rel="alternate" href="/atom.xml" title="gdme1320 的笔记" type="application/atom+xml">
  
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" integrity="sha384-XdYbMnZ/QjLh6iI4ogqCTaIjrFk87ip+ekIjefZch0Y+PvJ8CDYtEs1ipDmPorQ+" crossorigin="anonymous">

  <link rel="stylesheet" href="/css/styles.css">
  <link rel="stylesheet" href="/css/docs.min.css">
  

</head>
</html>
<body>
  <nav class="navbar navbar-inverse">
  <div class="container">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#main-menu-navbar" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="main-menu-navbar">
      <ul class="nav navbar-nav">
        
          <li><a class href="/index.html">Home</a></li>
        
          <li><a class href="/archives/">Archives</a></li>
        
      </ul>

      <!--
      <ul class="nav navbar-nav navbar-right">
        
          <li><a href="/atom.xml" title="RSS Feed"><i class="fa fa-rss"></i></a></li>
        
      </ul>
      -->
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>

  <div class="container bs-docs-container">
  
    <div class="row">
        <div class="col-sm-8 blog-main">
          <article id="post-python/import" class="article article-type-post" itemscope itemprop="blogPost">

  <header class="article-header">
    
  
    <h1 class="article-title" itemprop="name">
      Python Import
    </h1>
  


  </header>

  <div class="article-meta">
    <div class="article-datetime">
  <a href="/python/import/" class="article-date"><time datetime="2018-03-30T16:00:00.000Z" itemprop="datePublished">2018-03-31</time></a>
</div>

    
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/python/">python</a>
  </div>


  </div>
  <div class="article-inner">

    <div class="article-entry" itemprop="articleBody">
      
        
<div id="content">
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org673bc26">Example 1, Import a python module with python interpreter:</a></li>
<li><a href="#orgb3d817b">Example 2, Use execfile or (exec in Python 3) in a script to execute the other python file in place:</a></li>
<li><a href="#orgaab1813">Example 3, Use from … import … functionality:</a></li>
<li><a href="#org3b2a199">Example 4, Import riaa.py if it's in a different file location from where it is imported</a></li>
<li><a href="#orgd5192e0">Example 5, use os.system("python yourfile.py")</a></li>
<li><a href="#orgb6a95ff">Example 6, import your file via piggybacking the python startuphook:</a></li>
<li><a href="#org47ad4d9">Example 7, Most Robust: Import files in python with the bare import command:</a></li>
</ul>
</div>
</div>
<blockquote>
<p>
<a href="https://stackoverflow.com/questions/2349991/python-how-to-import-other-python-files" target="_blank" rel="noopener">https://stackoverflow.com/questions/2349991/python-how-to-import-other-python-files</a>
</p>
</blockquote>
<p>
There are many ways to import a python file, all with their pros and cons.
</p>
<p>
Don't just hastily pick the first import strategy that works for you or else you'll have to rewrite the codebase later on when you find it doesn't meet your needs.
</p>
<p>
I'll start out explaining the easiest example #1, then I'll move toward the most professional and robust example #7
</p>
<div class="outline-2" id="outline-container-org673bc26">
<h2 id="org673bc26">Example 1, Import a python module with python interpreter:</h2>
<div class="outline-text-2" id="text-org673bc26">
<ol class="org-ol">
<li>Put this in /home/el/foo/fox.py:</li>
</ol>
<div class="org-src-container">
<pre class="src src-python"><span style="font-weight: bold;">def</span> <span style="font-weight: bold;">what_does_the_fox_say</span>():
    <span style="font-weight: bold;">print</span>(<span style="font-style: italic;">"vixens cry"</span>)
</pre>
</div>
<ol class="org-ol">
<li>Get into the python interpreter:</li>
</ol>
<div class="org-src-container">
<pre class="src src-sh">el@apollo:/home/el/foo$ python
  Python 2.7.3 (default, Sep 26 2013, 20:03:06) 
  &gt;&gt;&gt; import fox
  &gt;&gt;&gt; fox.what_does_the_fox_say()
  vixens cry
  &gt;&gt;&gt; 
</pre>
</div>
<p>
You imported fox through the python interpreter, invoked the python function ```what_does_the_fox_say()``` from within fox.py.
</p>
</div>
</div>
<div class="outline-2" id="outline-container-orgb3d817b">
<h2 id="orgb3d817b">Example 2, Use execfile or (exec in Python 3) in a script to execute the other python file in place:</h2>
<div class="outline-text-2" id="text-orgb3d817b">
<ol class="org-ol">
<li>Put this in /home/el/foo2/mylib.py:</li>
</ol>
<div class="org-src-container">
<pre class="src src-python"><span style="font-weight: bold;">def</span> <span style="font-weight: bold;">moobar</span>():
  <span style="font-weight: bold;">print</span>(<span style="font-style: italic;">"hi"</span>)
</pre>
</div>
<ol class="org-ol">
<li>Put this in /home/el/foo2/main.py:</li>
</ol>
<div class="org-src-container">
<pre class="src src-python"><span style="font-weight: bold;">execfile</span>(<span style="font-style: italic;">"/home/el/foo2/mylib.py"</span>)
moobar()
</pre>
</div>
<ol class="org-ol">
<li>run the file:</li>
</ol>
<pre class="example">
el@apollo:/home/el/foo$ python main.py
hi
</pre>
<p>
The function moobar was imported from mylib.py and made available in main.py
</p>
</div>
</div>
<div class="outline-2" id="outline-container-orgaab1813">
<h2 id="orgaab1813">Example 3, Use from … import … functionality:</h2>
<div class="outline-text-2" id="text-orgaab1813">
<ol class="org-ol">
<li>Put this in /home/el/foo3/chekov.py:</li>
</ol>
<div class="org-src-container">
<pre class="src src-python"><span style="font-weight: bold;">def</span> <span style="font-weight: bold;">question</span>():
  <span style="font-weight: bold;">print</span> <span style="font-style: italic;">"where are the nuclear wessels?"</span>
</pre>
</div>
<ol class="org-ol">
<li>Put this in /home/el/foo3/main.py:</li>
</ol>
<div class="org-src-container">
<pre class="src src-python"><span style="font-weight: bold;">from</span> chekov <span style="font-weight: bold;">import</span> question
question()
</pre>
</div>
<ol class="org-ol">
<li>Run it like this:</li>
</ol>
<div class="org-src-container">
<pre class="src src-python">el@apollo:/home/el/foo3$ python main.py 
where are the nuclear wessels?
</pre>
</div>
<p>
If you defined other functions in chekov.py, they would not be available unless you import *
</p>
</div>
</div>
<div class="outline-2" id="outline-container-org3b2a199">
<h2 id="org3b2a199">Example 4, Import riaa.py if it's in a different file location from where it is imported</h2>
<div class="outline-text-2" id="text-org3b2a199">
<ol class="org-ol">
<li>Put this in /home/el/foo4/stuff/riaa.py:</li>
</ol>
<div class="org-src-container">
<pre class="src src-python"><span style="font-weight: bold;">def</span> <span style="font-weight: bold;">watchout</span>():
  <span style="font-weight: bold;">print</span> <span style="font-style: italic;">"computers are transforming into a noose and a yoke for humans"</span>
</pre>
</div>
<ol class="org-ol">
<li>Put this in /home/el/foo4/main.py:</li>
</ol>
<div class="org-src-container">
<pre class="src src-python"><span style="font-weight: bold;">import</span> sys 
<span style="font-weight: bold;">import</span> os
sys.path.append(os.path.abspath(<span style="font-style: italic;">"/home/el/foo4/stuff"</span>))
<span style="font-weight: bold;">from</span> riaa <span style="font-weight: bold;">import</span> *
watchout()
</pre>
</div>
<ol class="org-ol">
<li>Run it:</li>
</ol>
<div class="org-src-container">
<pre class="src src-python">el@apollo:/home/el/foo4$ python main.py 
computers are transforming into a noose <span style="font-weight: bold;">and</span> a yoke <span style="font-weight: bold;">for</span> humans
</pre>
</div>
<p>
That imports everything in the foreign file from a different directory.
</p>
</div>
</div>
<div class="outline-2" id="outline-container-orgd5192e0">
<h2 id="orgd5192e0">Example 5, use os.system("python yourfile.py")</h2>
<div class="outline-text-2" id="text-orgd5192e0">
<div class="org-src-container">
<pre class="src src-python"><span style="font-weight: bold;">import</span> os
os.system(<span style="font-style: italic;">"python yourfile.py"</span>)
</pre>
</div>
</div>
</div>
<div class="outline-2" id="outline-container-orgb6a95ff">
<h2 id="orgb6a95ff">Example 6, import your file via piggybacking the python startuphook:</h2>
<div class="outline-text-2" id="text-orgb6a95ff">
<p>
See: <a href="https://docs.python.org/2/library/user.html" target="_blank" rel="noopener">https://docs.python.org/2/library/user.html</a>
</p>
<p>
Put this code into your home directory in ~/.pythonrc.py
</p>
<div class="org-src-container">
<pre class="src src-python"><span style="font-weight: bold;">class</span> <span style="font-weight: bold; text-decoration: underline;">secretclass</span>:
<span style="font-weight: bold;">def</span> <span style="font-weight: bold;">secretmessage</span>(cls, myarg):
<span style="font-weight: bold;">return</span> myarg + <span style="font-style: italic;">" is if.. up in the sky, the sky"</span>
<span style="font-weight: bold; font-style: italic;">secretmessage</span> = <span style="font-weight: bold;">classmethod</span>( secretmessage )

<span style="font-weight: bold;">def</span> <span style="font-weight: bold;">skycake</span>(cls):
<span style="font-weight: bold;">return</span> <span style="font-style: italic;">"cookie and sky pie people can't go up and "</span>
<span style="font-weight: bold; font-style: italic;">skycake</span> = <span style="font-weight: bold;">classmethod</span>( skycake )
<span style="font-weight: bold; font-style: italic;">#</span><span style="font-weight: bold; font-style: italic;">+EDN_SRC</span>
Put this code into your main.py (can be anywhere):
<span style="font-weight: bold; font-style: italic;">#</span><span style="font-weight: bold; font-style: italic;">+BEGIN_SRC python</span>
<span style="font-weight: bold;">import</span> user
<span style="font-weight: bold; font-style: italic;">msg</span> = <span style="font-style: italic;">"The only way skycake tates good"</span> 
<span style="font-weight: bold; font-style: italic;">msg</span> = user.secretclass.secretmessage(msg)
<span style="font-weight: bold; font-style: italic;">msg</span> += user.secretclass.skycake()
<span style="font-weight: bold;">print</span>(msg + <span style="font-style: italic;">" have the sky pie! SKYCAKE!"</span>)
</pre>
</div>
<p>
Run it:
</p>
<div class="org-src-container">
<pre class="src src-python">$ python main.py
The only way skycake tates good <span style="font-weight: bold;">is</span> <span style="font-weight: bold;">if</span>.. up <span style="font-weight: bold;">in</span> the sky, 
the skycookie <span style="font-weight: bold;">and</span> sky pie people can<span style="font-style: italic;">'t go up and  have the sky pie! </span>
<span style="font-style: italic;">SKYCAKE!</span>
</pre>
</div>
<p>
Credit for this jist goes to: <a href="https://github.com/docwhat/homedir-examples/blob/master/python-commandline/.pythonrc.py" target="_blank" rel="noopener">https://github.com/docwhat/homedir-examples/blob/master/python-commandline/.pythonrc.py</a> Send along your up-boats.
</p>
</div>
</div>
<div class="outline-2" id="outline-container-org47ad4d9">
<h2 id="org47ad4d9">Example 7, Most Robust: Import files in python with the bare import command:</h2>
<div class="outline-text-2" id="text-org47ad4d9">
<ol class="org-ol">
<li>Make a new directory <i>home/el/foo5</i></li>
<li>Make a new directory /home/el/foo5/herp</li>
<li>Make an empty file named <span class="underline"><span class="underline">init</span></span>.py under herp:</li>
</ol>
<div class="org-src-container">
<pre class="src src-sh">el@apollo:/home/el/foo5/herp$ touch __init__.py
el@apollo:/home/el/foo5/herp$ ls
__init__.py
</pre>
</div>
<ol class="org-ol">
<li>Make a new directory /home/el/foo5/herp/derp</li>
<li>Under derp, make another <span class="underline"><span class="underline">init</span></span>.py file:</li>
</ol>
<div class="org-src-container">
<pre class="src src-sh">el@apollo:/home/el/foo5/herp/derp$ touch __init__.py
el@apollo:/home/el/foo5/herp/derp$ ls
__init__.py
</pre>
</div>
<ol class="org-ol">
<li>Under /home/el/foo5/herp/derp make a new file called yolo.py Put this in there:</li>
</ol>
<div class="org-src-container">
<pre class="src src-python"><span style="font-weight: bold;">def</span> <span style="font-weight: bold;">skycake</span>():
  <span style="font-weight: bold;">print</span> <span style="font-style: italic;">"SkyCake evolves to stay just beyond the cognitive reach of "</span> +
  <span style="font-style: italic;">"the bulk of men. SKYCAKE!!"</span>
</pre>
</div>
<ol class="org-ol">
<li>The moment of truth, Make the new file /home/el/foo5/main.py, put this in there;</li>
</ol>
<div class="org-src-container">
<pre class="src src-python"><span style="font-weight: bold;">from</span> herp.derp.yolo <span style="font-weight: bold;">import</span> skycake
skycake()
</pre>
</div>
<ol class="org-ol">
<li>Run it:</li>
</ol>
<div class="org-src-container">
<pre class="src src-sh">el@apollo:/home/el/foo5$ python main.py
SkyCake evolves to stay just beyond the cognitive reach of the bulk 
of men. SKYCAKE!!
</pre>
</div>
<p>
The empty <span class="underline"><span class="underline">init</span></span>.py file communicates to the python interpreter that the developer intends this directory to be an importable package.
</p>
<p>
If you want to see my post on how to include ALL .py files under a directory see here: <a href="https://stackoverflow.com/a/20753073/445131" target="_blank" rel="noopener">https://stackoverflow.com/a/20753073/445131</a>
</p>
</div>
</div>
</div>
<div class="status" id="postamble">
<p class="date">Date: 2018-3-31</p>
<p class="author">Author: stackoverflow</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer" target="_blank" rel="noopener">Validate</a></p>
</div>

      
    </div>

    
      

    

    <footer class="article-footer">
      <a data-url="http://gdme1320.gitee.com/python/import/" data-id="cl13eo7k6008vhjv4du8irzrs" class="article-share-link">
        <i class="fa fa-share"></i> Share
      </a>
      
      

    </footer>
  </div>
  
    
<ul id="article-nav" class="nav nav-pills nav-justified">
  
  <li role="presentation">
    <a href="/python/connect-mssql/" id="article-nav-older" class="article-nav-link-wrap">
      <i class="fa fa-chevron-left pull-left"></i>
      <span class="article-nav-link-title">Python连接SQLServer</span>
    </a>
  </li>
  
  
  <li role="presentation">
    <a href="/rfc/rfc6749-oauth2/" id="article-nav-newer" class="article-nav-link-wrap">
      <span class="article-nav-link-title">OAuth2认证方式</span>
      <i class="fa fa-chevron-right pull-right"></i>
    </a>
  </li>
  
</ul>


  
</article>




        </div>
        <div class="col-sm-3 col-sm-offset-1 blog-sidebar">
          
  
  <div class="sidebar-module">
    <h4>Categories</h4>
    <ul class="sidebar-module-list"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/apps/">apps</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/architecture/">architecture</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/devops/">devops</a><span class="sidebar-module-list-count">10</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/devops/kubectl/">kubectl</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/devops/kubernetes/">kubernetes</a><span class="sidebar-module-list-count">3</span></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/dotnet/">dotnet</a><span class="sidebar-module-list-count">3</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/dotnet/entityframework/">entityframework</a><span class="sidebar-module-list-count">1</span></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/elasticsearch/">elasticsearch</a><span class="sidebar-module-list-count">4</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/emacs/">emacs</a><span class="sidebar-module-list-count">4</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/emacs/org-mode/">org-mode</a><span class="sidebar-module-list-count">3</span></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/git/">git</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/graphql/">graphql</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/groovy/">groovy</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/">java</a><span class="sidebar-module-list-count">52</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/concurrent/">concurrent</a><span class="sidebar-module-list-count">4</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/jackson/">jackson</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/shiro/">shiro</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/spring/">spring</a><span class="sidebar-module-list-count">11</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/spring-amqp/">spring-amqp</a><span class="sidebar-module-list-count">5</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/spring-amqp/spring-jpa/">spring-jpa</a><span class="sidebar-module-list-count">1</span></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/spring-jpa/">spring-jpa</a><span class="sidebar-module-list-count">10</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/spring-security/">spring-security</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/thymeleaf/">thymeleaf</a><span class="sidebar-module-list-count">2</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/thymeleaf/maven/">maven</a><span class="sidebar-module-list-count">1</span></li></ul></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/jenkins/">jenkins</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/journal/">journal</a><span class="sidebar-module-list-count">7</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/js/">js</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/linux/">linux</a><span class="sidebar-module-list-count">35</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/linux/kde/">kde</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/linux/kross/">kross</a><span class="sidebar-module-list-count">3</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/linux/kross/ktorrent-scripts/">ktorrent-scripts</a><span class="sidebar-module-list-count">1</span></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/linux/shell/">shell</a><span class="sidebar-module-list-count">6</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/linux/tcp/">tcp</a><span class="sidebar-module-list-count">1</span></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/lisp/">lisp</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/mongodb/">mongodb</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/mssql/">mssql</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/mysql/">mysql</a><span class="sidebar-module-list-count">12</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/nginx/">nginx</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/node/">node</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/postgresql/">postgresql</a><span class="sidebar-module-list-count">2</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/postgresql/client/">client</a><span class="sidebar-module-list-count">1</span></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/python/">python</a><span class="sidebar-module-list-count">19</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/regex/">regex</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/rfc/">rfc</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/vim/">vim</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/windows/">windows</a><span class="sidebar-module-list-count">7</span></li></ul>
  </div>



  
  <div class="sidebar-module">
    <h4>Tags</h4>
    <ul class="sidebar-module-list"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/ReentrantLock/">ReentrantLock</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/nohup/">nohup</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/pandoc/">pandoc</a><span class="sidebar-module-list-count">1</span></li></ul>
  </div>



  
  <div class="sidebar-module">
    <h4>Tag Cloud</h4>
    <p class="tagcloud">
      <a href="/tags/ReentrantLock/" style="font-size: 10px;">ReentrantLock</a> <a href="/tags/nohup/" style="font-size: 10px;">nohup</a> <a href="/tags/pandoc/" style="font-size: 10px;">pandoc</a>
    </p>
  </div>


  
  <div class="sidebar-module">
    <h4>Archives</h4>
    <ul class="sidebar-module-list"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2919/06/">June 2919</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2022/03/">March 2022</a><span class="sidebar-module-list-count">58</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2022/01/">January 2022</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2021/11/">November 2021</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2021/10/">October 2021</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2021/04/">April 2021</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2021/03/">March 2021</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2021/02/">February 2021</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2021/01/">January 2021</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/12/">December 2020</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/11/">November 2020</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/10/">October 2020</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/09/">September 2020</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/07/">July 2020</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/06/">June 2020</a><span class="sidebar-module-list-count">10</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/04/">April 2020</a><span class="sidebar-module-list-count">4</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/03/">March 2020</a><span class="sidebar-module-list-count">8</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/02/">February 2020</a><span class="sidebar-module-list-count">4</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/01/">January 2020</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/12/">December 2019</a><span class="sidebar-module-list-count">7</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/11/">November 2019</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/10/">October 2019</a><span class="sidebar-module-list-count">11</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/09/">September 2019</a><span class="sidebar-module-list-count">6</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/08/">August 2019</a><span class="sidebar-module-list-count">4</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/07/">July 2019</a><span class="sidebar-module-list-count">10</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/06/">June 2019</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/05/">May 2019</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/04/">April 2019</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/03/">March 2019</a><span class="sidebar-module-list-count">8</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/02/">February 2019</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/01/">January 2019</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2018/11/">November 2018</a><span class="sidebar-module-list-count">4</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2018/10/">October 2018</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2018/08/">August 2018</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2018/07/">July 2018</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2018/06/">June 2018</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2018/03/">March 2018</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2017/07/">July 2017</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2017/06/">June 2017</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2017/04/">April 2017</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2015/05/">May 2015</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/1970/01/">January 1970</a><span class="sidebar-module-list-count">9</span></li></ul>
  </div>



  
  <div class="sidebar-module">
    <h4>Recents</h4>
    <ul class="sidebar-module-list">
      
        <li>
          <a href="/java/acessing-generic-types-at-runtime/">获取泛型类型</a>
        </li>
      
        <li>
          <a href="/linux/shell/bash_cgi/">Script for Shell Parsing Parameters</a>
        </li>
      
        <li>
          <a href="/linux/shell/shell-script/">Shell Script Getting Start</a>
        </li>
      
        <li>
          <a href="/linux/tcp/network-tcp-performance-turning-with-sysctl/">【翻译】Sysctl调节Linux网络性能</a>
        </li>
      
        <li>
          <a href="/java/concurrent/aqs-src/">AQS源码笔记</a>
        </li>
      
    </ul>
  </div>



        </div>
    </div>
  </div>
  <footer class="blog-footer">
  <div class="container">
    <div id="footer-info" class="inner">
      &copy; 2022 gdme1320<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>

  

<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" integrity="sha384-8gBf6Y4YYq7Jx97PIqmTwLPin4hxIzQw5aDmUg/DDhul9fFpbbLcLh3nTIIDJKhx" crossorigin="anonymous"></script> -->

<script src="/js/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>



<script src="/js/script.js"></script>

</body>
</html>
